/*
* $Id: TransactManager.h 292 2011-03-24 21:08:17Z volok-aleksej@yandex.ru $
*
* Copyright 2009-2011 by Volokitin Aleksey
* All rights reserved
*
*/
#ifndef _TRANSACT_MANAGER_H_
#define _TRANSACT_MANAGER_H_

class CTransactManager
{
public:
	enum type
	{
		POINT = 1,
		FAMILY,
		JOURNAL,
		HOUSING,
		QUEEN_BEE,
		FIELD_VALUE
	};
	struct ID
	{
		type m_type;
		int m_id;
		ID(type tp, int id)
			: m_type(tp), m_id(id){}
		bool operator < (const ID& id) const{
			if(m_type < id.m_type)
				return true;
			else if(m_type == id.m_type)
				return m_id < id.m_id;
			else
				return false;
		}
	};
public:
	CTransactManager();
	~CTransactManager();
public:
	void AddIDMap(ID idMap, int realId);
	int GetRealId(ID idMap, bool* bExist = NULL);
private:
	std::map<ID, int> m_aIDMap;
};

#endif/*_TRANSACT_MANAGER_H_*/